<!DOCTYPE html>
<html>

    <head>
        <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1" />
        <meta charset="UTF-8">
        <title>{$site_info.site_name|default=''}</title>
        <meta name="keywords" content="{$site_info.site_seo_keywords|default=''}"/>
        <meta name="description" content="{$site_info.site_seo_description|default=''}">
        <include file="public@head"/>
    </head>

    <body>

        <div class="regime">
            <div class="head" style="background: url({:cmf_get_image_url($img['img'])}) no-repeat;background-size: 100% 100%;">
                <p>制度指南</p>
            </div>

            <div class="reCondition">
                <foreach name="category" item="vo" key="k">
                <if condition="$Request.param.cat">
                <p <if condition="$Request.param.cat eq $vo.id">class="sel"</if>>{$vo.name}</p>
                <else/>
                <p <if condition="$k eq 0">class="sel"</if>>{$vo.name}</p>
                </if>
                </foreach>

            </div>

            <div class="reAll">
                <foreach name="category" item="vo" key="k">
                <if condition="$Request.param.cat">
                <div class="reCn div_float <if condition='$k eq 0'>reCnOne<else/>reCnTwo</if><if condition='$Request.param.cat neq $vo.id'> divHide</if>">
                <else/>
                <div class="reCn div_float <if condition='$k eq 0'>reCnOne<else/>reCnTwo divHide</if>">
                </if>
                    <div class="l">
                        <div class="sub">
                            <foreach name="$vo.sub_cate" item="vo2" key="k2">
                             <p <if condition="$k2 eq 0">class="sel"</if>>{$vo2.name}</p>
                            </foreach>
                        </div>
                    </div>
                    <div class="r div_float">
                        <foreach name="$vo.sub_cate" item="vo2" key="k2">
                        <div class="sub <if condition='$k2 neq 0'>divHide</if>">
                            <foreach name="$vo2.lists" item="vo3" key="k3">
                            <a href="{:cmf_url('portal/List/detail',array('id'=>$vo3['post_id'],'cat'=>$vo['id']))}">
                            <div class="list div_float">
                                <span></span>
                                <p>{$vo3.post_title}</p>
                            </div>
                            </a>
                            </foreach>
                        </div>
                        </foreach>
                    </div>
                </div>
                </foreach>
            </div>

            <!--公共底部-->
            <include file='public@footer'/>

        </div>

        <include file='public@scripts'/>
        <script>
            $(function() {
                //点击切换制度(一级)
                $('.reCondition>p').on('click', function() {
                    $(this).addClass('sel').siblings().removeClass('sel');
                    var sIndex = $(this).index();
                    console.log(sIndex)
                    if(sIndex == 0) {
                        $('.reCnOne').removeClass('divHide');
                        $('.reCnTwo').addClass('divHide');
                    } else {
                        $('.reCnTwo').removeClass('divHide');
                        $('.reCnOne').addClass('divHide');
                    }
                });
            });
            
            //点击切换制度(二级)
            $('.reCn>.l p').on('click',function(){
                $(this).addClass('sel').siblings().removeClass('sel');
                var fIndex = $(this).parents('.reCn').index();
                var sIndex = parseInt($(this).index())+1;
                
                if(fIndex == 0){
                    $('.reCnOne .r>div:nth-child('+sIndex+')').removeClass('divHide').siblings().addClass('divHide');
                }else{
                    $('.reCnTwo .r>div:nth-child('+sIndex+')').removeClass('divHide').siblings().addClass('divHide');
                }
            });
        </script>
    </body>

</html>